/*
 *  Copyright (C) 2010 Francesco Boffa (aka AlfaOmega08)
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package ImageFormats.Iso9660;

import java.io.*;

public class DateTime {
	private int Year = 0;
	private int Month;
	private int Day;
	private int Hour;
	private int Minute;
	private int Second;
	private int Hundredths;
	private int GmtOffset;

	public void getFromByteStream() {
	}

	public void getFromAsciiStream(RandomAccessFile f) {
		try {
			byte[] tmp = new byte[17];
			f.read(tmp, 0, 17);

			String str = new String(tmp, 0, 4);
			Year = Integer.parseInt(str);
			str = new String(tmp, 4, 2);
			Month = Integer.parseInt(str);
			str = new String(tmp, 6, 2);
			Day = Integer.parseInt(str);
			str = new String(tmp, 8, 2);
			Hour = Integer.parseInt(str);
			str = new String(tmp, 10, 2);
			Minute = Integer.parseInt(str);
			str = new String(tmp, 12, 2);
			Second = Integer.parseInt(str);
			str = new String(tmp, 14, 2);
			Hundredths = Integer.parseInt(str);
			GmtOffset = (tmp[16] * 15) / 60;
		} catch (IOException e) {
			System.out.println("IOException while reading datetime from ascii stream: " + e.getMessage());
		}
	}
}
